﻿using FairyGUI;

/// <summary>
/// 帮助
/// </summary>
public class UIHome_Help : UIPopupWindow {

    public UIHome_Help()
    {
        // 加载界面
        base.Init(UIPackage.CreateObject("主界面", "玩法组件").asCom);

        // 初始化关闭按钮
        GButton closeBtn = uiComp.GetChild("关闭按钮").asButton;
        closeBtn.onClick.Add(() => {
            DebugInfo.Log("关闭玩法");

            AudioController.inst.PlayUIClickEffect();
            uiComp.RemoveFromParent();
            uiComp.Dispose();
            base.Close();
        });
    }

    /// <summary>
    /// 弹出窗口
    /// </summary>
    public static void Popup()
    {
        DebugInfo.Log("打开玩法");
        UIRootController.inst.PopupWindow(new UIHome_Help());
    }
}
